package com.example.demo.controller;

import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2023-02-17
 * Time: 18:43
 */
@RestController
public class UserController {

    private UserService userService;

    @Autowired
    public UserController(UserService userService) {
        this.userService = userService;
        System.out.println("执行带参数的构造方法");
    }


    public UserController() {

        System.out.println("执行不带参数的构造方法");
        System.out.println();
    }
}









































